<?php
App::uses('AppModel', 'Model');
/**
 * Conferencereport Model
 *
 * @property Conferencetype $Conferencetype
 * @property Conferenceleveltype $Conferenceleveltype
 * @property Recstatus $Recstatus
 */
class Conferencereport extends AppModel {

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'conferencetype_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Выберите тип конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'conferenceleveltype_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Выберите уровень конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'conference_name' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'begindate' => array(
			'date' => array(
				'rule' => array('date'),
				'message' => 'Введите дату начала конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'enddate' => array(
			'date' => array(
				'rule' => array('date'),
				'message' => 'Введите дату окончания конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'conference_place' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите место проведения конференции',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'conferencereporttype_id' => array(
				'notEmpty' => array(
						'rule' => array('numeric'),
						'message' => 'Выберите тип доклада',
						//'allowEmpty' => false,
						//'required' => false,
						//'last' => false, // Stop validation after this rule
						//'on' => 'create', // Limit validation to 'create' or 'update' operations
				),
		),
				
		'report_name' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty'),
				'message' => 'Введите название выступления с докладом',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'recstatus_id' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'Conferencetype' => array(
			'className' => 'Conferencetype',
			'foreignKey' => 'conferencetype_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Conferenceleveltype' => array(
			'className' => 'Conferenceleveltype',
			'foreignKey' => 'conferenceleveltype_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Conferencereporttype' => array(
			'className' => 'Conferencereporttype',
			'foreignKey' => 'conferencereporttype_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),			
		'Recstatus' => array(
			'className' => 'Recstatus',
			'foreignKey' => 'recstatus_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
